<template>
  <img alt="Vue logo" src="./assets/logo.png">
  <input v-model="inputText" placeholder="请输入内容">
  <HelloWorld :msg="inputText" @clear="clearInput"/>
</template>

<script>
import { ref } from 'vue'
import HelloWorld from './components/HelloWorld.vue'

export default {
  name: 'App',
  components: {
    HelloWorld
  },
  setup() {
    const inputText = ref('')

    const clearInput = () => {
      inputText.value = ''
    }

    return {
      inputText,
      clearInput
    }
  }
}
</script>


<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
input{
  display: block;
  margin-left: 45%;
}
</style>
